--- Wnn/etc/pwd.c.orig
+++ Wnn/etc/pwd.c
@@ -57,36 +57,20 @@
 #include "jslib.h"
 #include "wnn_os.h"
 #endif
+#include <unistd.h>
+#include <string.h>
 
 extern char *crypt();
+#define salt "$2a$08$bonjourcommentcavatoie"
 
+
 #ifdef JS
 static
 #endif
 void
-new_pwd(src, encd)
-char *src, *encd;
+new_pwd(char *src, char *encd)
 {
-    int i, x,c;
-    char xx[2];
-    char *cr;
-
-    if(encd == NULL)encd = src;
-    if(strcmp(src, "") == 0){ bzero(encd, WNN_PASSWD_LEN);return;}
-    x = time(NULL);
-    xx[0] = x & 0x3f;
-    xx[1] = (x & 0x3f00) >> 8;
-    for (i = 0; i < 2; i++) {
-	c = xx[i] + '.';
-	if (c > '9')
-	    c += 7;
-	if (c > 'Z')
-	    c += 6;
-	xx[i] = c;
-    }
-    cr = crypt(src, xx);
-    bzero(encd, WNN_PASSWD_LEN);
-    strncpy(encd, cr, WNN_PASSWD_LEN);
+    crypt_newhash(src, NULL, encd, WNN_PASSWD_LEN);
 }
 
 #ifdef JS
@@ -97,5 +81,5 @@ check_pwd(src, encd)
 char *src, *encd;
 {
     if(strcmp(encd, "") == 0) return(1);  /* No passwd */
-    return(!strncmp(encd, crypt(src, encd),WNN_PASSWD_LEN));
+    return crypt_checkpass(src, encd) == 0;
 }
